public class Test {
    public void reverseString(char[] s) {
        int left=0, right=s.length-1;
        while(left<right){
            char temp=s[left];
            s[left]=s[right];
            s[right]=temp;
            left++;
            right--;
        }
    }

    public static void main(String[] args) {
        Test test=new Test();
        char[] s={'h','e','l','l','o'};
        test.reverseString(s);
        System.out.println(s);
    }
}
